home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gekikoh Dennoh Club 1
/
Gekikoh Dennoh Club Vol. 1 (Japan).7z
/
Gekikoh Dennoh Club Vol. 1 (Japan) (Track 1).bin
/
kowin
/
archive
/
apl
/
gview120.lzh
/
gviewsrc.lzh
/
jpg_load.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-02-13
|
1KB
|
50 lines
/* Copyright 1992 H.Ogasawara (COR.) */
#include <corlib.h>
#include <sys_doslib.h>
#include "gview.h"
#define JPSIZEX 480
#define JPSIZEY 480
#define JPLOADER "jpeged.r"
#define JPOPTION "-L0,0 -F3 -VS480,480,$"
GVIEW *
GV_Load_Jpeg( fname )
char *fname;
{
if( CHMOD( fname, -1 ) >= 0 ){
GVIEW *gp;
unsigned char line[256];
if( !(gp= GV_Alloc( JPSIZEX, JPSIZEY, WindowAttrGraphic65536,
fname, NULL, 0 )) ){
GV_Err( "メモリが足りません" );
return NULL;
}
memset( gp->buf, 0, JPSIZEX*JPSIZEY*2 );
{
unsigned int i, num= (int)gp->buf;
unsigned char *str= line, *ptr= JPOPTION;
for(; *ptr ; *str++= *ptr++ );
for( i= 0 ; i< 6 ; i++, num<<= 4 ){
*str++= ((char*)"0123456789abcdef")
[(num >>20)&15];
}
*str++= ' ';
for( ptr= fname ; *ptr ; *str++= *ptr++ );
*str++= '\0';
}
ConsoleOpen();
if( WindowLoadExec( JPLOADER, line, NULL, ConsoleChar ) ){
MFREE( gp );
GV_Err2( JPLOADER, "実行できませんでした" );
return NULL;
}
WindowScreenInit();
return gp;
}
GV_Err2( fname, "ファイルがありません" );
return NULL;
}